﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TeamsPortal.DataAccess;

namespace TeamsPortal.ServiceClient
{
    public interface ITopicsSubscriptionsServiceClient
    {
        /// <summary>
        /// Subscribes a user to a topic. If the user is already subscribed it does nothing.
        /// </summary>
        void Add(int topicId, int userId);

        /// <summary>
        /// Unsubscribes a user to a topic. If the user is not subscribed it does nothing. Returns the records affected.
        /// </summary>
        /// <param name="userGuid">User global uid</param>
        int Remove(int topicId, int userId, Guid userGuid);

        /// <summary>
        /// Gets users subscribed to a topic
        /// </summary>
        List<User> GetSubscribed(int topicId);

        /// <summary>
        /// Gets the topics to which the user subscribed to
        /// </summary>
        List<Topic> GetTopics(int userId);

        void SendNotifications(Topic topic, int userId, string url, string unsubscribeUrl);
    }
}
